export enum RedPointEvent  {
    RoleCount,
    PhoneCount,
    TipCount,
    MissionCount,
    CheckAwardCount,
}
export default class RedPointManager extends cc.EventTarget {
    private static _instance: RedPointManager = null;
    public static get instance(): RedPointManager {
        if (this._instance == null) {
            this._instance = new RedPointManager();
        }
        return this._instance;
    }
    public updateNum(event: RedPointEvent,num:number) {
        this.emit(event.toString(), num);
    }
    public register(event: RedPointEvent, target: any, callfunk: Function) {
        this.on(event.toString(), callfunk, target);
    }
    public unregister(event: RedPointEvent, target: any, callfunk: Function) {
        this.off(event.toString(), callfunk, target)
    }
    //取消一个目标上所有的事件
    public targetOff(target: any) {
        this.targetOff(target);
    }
}
